// Copyright 2025 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated file. DO NOT EDIT.

// Package swarming provides access to the .
//
// # Library status
//
// These client libraries are officially supported by Google. However, this
// library is considered complete and is in maintenance mode. This means
// that we will address critical bugs and security issues but will not add
// any new features.
//
// When possible, we recommend using our newer
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
// that are still actively being worked and iterated on.
//
// # Creating a client
//
// Usage example:
//
//	import "go.chromium.org/luci/common/api/swarming/swarming/v1"
//	...
//	ctx := context.Background()
//	swarmingService, err := swarming.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for
// authentication. For information on how to create and obtain Application
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
//	swarmingService, err := swarming.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
// flow, use [google.golang.org/api/option.WithTokenSource]:
//
//	config := &oauth2.Config{...}
//	// ...
//	token, err := config.Exchange(ctx, ...)
//	swarmingService, err := swarming.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package swarming // import "go.chromium.org/luci/common/api/swarming/swarming/v1"

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"log/slog"
	"net/http"
	"net/url"
	"strconv"
	"strings"

	"github.com/googleapis/gax-go/v2/internallog"
	googleapi "google.golang.org/api/googleapi"
	gensupport "go.chromium.org/luci/common/api/internal/gensupport"
	option "google.golang.org/api/option"
	internaloption "google.golang.org/api/option/internaloption"
	htransport "google.golang.org/api/transport/http"
)

// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
var _ = "luci-go"
var _ = internallog.New

const apiId = "swarming:v1"
const apiName = "swarming"
const apiVersion = "v1"
const basePath = "http://localhost:8080/_ah/api/swarming/v1"
const basePathTemplate = "http://localhost:8080/_ah/api/swarming/v1"

// OAuth2 scopes used by this API.
const (
	// https://www.googleapis.com/auth/userinfo.email
	UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
)

// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
	scopesOption := internaloption.WithDefaultScopes(
		"https://www.googleapis.com/auth/userinfo.email",
	)
	// NOTE: prepend, so we don't override user-specified scopes.
	opts = append([]option.ClientOption{scopesOption}, opts...)
	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
	opts = append(opts, internaloption.EnableNewAuthLibrary())
	client, endpoint, err := htransport.NewClient(ctx, opts...)
	if err != nil {
		return nil, err
	}
	s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
	s.Bot = NewBotService(s)
	s.Bots = NewBotsService(s)
	s.Queues = NewQueuesService(s)
	s.Server = NewServerService(s)
	s.Task = NewTaskService(s)
	s.Tasks = NewTasksService(s)
	if err != nil {
		return nil, err
	}
	if endpoint != "" {
		s.BasePath = endpoint
	}
	return s, nil
}

// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
	if client == nil {
		return nil, errors.New("client is nil")
	}
	return NewService(context.Background(), option.WithHTTPClient(client))
}

type Service struct {
	client    *http.Client
	logger    *slog.Logger
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Bot *BotService

	Bots *BotsService

	Queues *QueuesService

	Server *ServerService

	Task *TaskService

	Tasks *TasksService
}

func (s *Service) userAgent() string {
	if s.UserAgent == "" {
		return googleapi.UserAgent
	}
	return googleapi.UserAgent + " " + s.UserAgent
}

func NewBotService(s *Service) *BotService {
	rs := &BotService{s: s}
	return rs
}

type BotService struct {
	s *Service
}

func NewBotsService(s *Service) *BotsService {
	rs := &BotsService{s: s}
	return rs
}

type BotsService struct {
	s *Service
}

func NewQueuesService(s *Service) *QueuesService {
	rs := &QueuesService{s: s}
	return rs
}

type QueuesService struct {
	s *Service
}

func NewServerService(s *Service) *ServerService {
	rs := &ServerService{s: s}
	return rs
}

type ServerService struct {
	s *Service
}

func NewTaskService(s *Service) *TaskService {
	rs := &TaskService{s: s}
	return rs
}

type TaskService struct {
	s *Service
}

func NewTasksService(s *Service) *TasksService {
	rs := &TasksService{s: s}
	return rs
}

type TasksService struct {
	s *Service
}

// SwarmingRpcsBootstrapToken: Returns a token to bootstrap a new bot.
type SwarmingRpcsBootstrapToken struct {
	BootstrapToken string `json:"bootstrap_token,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "BootstrapToken") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BootstrapToken") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBootstrapToken) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBootstrapToken
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsBotEvent struct {
	AuthenticatedAs string `json:"authenticated_as,omitempty"`
	// Dimensions: Represents a mapping of string to list of strings.
	Dimensions     []*SwarmingRpcsStringListPair `json:"dimensions,omitempty"`
	EventType      string                        `json:"event_type,omitempty"`
	ExternalIp     string                        `json:"external_ip,omitempty"`
	MaintenanceMsg string                        `json:"maintenance_msg,omitempty"`
	Message        string                        `json:"message,omitempty"`
	Quarantined    bool                          `json:"quarantined,omitempty"`
	State          string                        `json:"state,omitempty"`
	TaskId         string                        `json:"task_id,omitempty"`
	Ts             string                        `json:"ts,omitempty"`
	Version        string                        `json:"version,omitempty"`
	// ForceSendFields is a list of field names (e.g. "AuthenticatedAs") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "AuthenticatedAs") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBotEvent) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBotEvent
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsBotEvents struct {
	Cursor string                  `json:"cursor,omitempty"`
	Items  []*SwarmingRpcsBotEvent `json:"items,omitempty"`
	Now    string                  `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBotEvents) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBotEvents
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsBotInfo: Representation of the BotInfo ndb model.
type SwarmingRpcsBotInfo struct {
	AuthenticatedAs string `json:"authenticated_as,omitempty"`
	BotId           string `json:"bot_id,omitempty"`
	Deleted         bool   `json:"deleted,omitempty"`
	// Dimensions: Represents a mapping of string to list of strings.
	Dimensions         []*SwarmingRpcsStringListPair `json:"dimensions,omitempty"`
	ExternalIp         string                        `json:"external_ip,omitempty"`
	FirstSeenTs        string                        `json:"first_seen_ts,omitempty"`
	IsDead             bool                          `json:"is_dead,omitempty"`
	LastSeenTs         string                        `json:"last_seen_ts,omitempty"`
	LeaseExpirationTs  string                        `json:"lease_expiration_ts,omitempty"`
	LeaseId            string                        `json:"lease_id,omitempty"`
	LeasedIndefinitely bool                          `json:"leased_indefinitely,omitempty"`
	MachineLease       string                        `json:"machine_lease,omitempty"`
	MachineType        string                        `json:"machine_type,omitempty"`
	MaintenanceMsg     string                        `json:"maintenance_msg,omitempty"`
	Quarantined        bool                          `json:"quarantined,omitempty"`
	State              string                        `json:"state,omitempty"`
	TaskId             string                        `json:"task_id,omitempty"`
	TaskName           string                        `json:"task_name,omitempty"`
	Version            string                        `json:"version,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "AuthenticatedAs") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "AuthenticatedAs") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBotInfo) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBotInfo
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsBotList: Wraps a list of BotInfo.
type SwarmingRpcsBotList struct {
	Cursor       string `json:"cursor,omitempty"`
	DeathTimeout int64  `json:"death_timeout,omitempty,string"`
	// Items: Representation of the BotInfo ndb model.
	Items []*SwarmingRpcsBotInfo `json:"items,omitempty"`
	Now   string                 `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBotList) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBotList
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsBotTasks struct {
	Cursor string `json:"cursor,omitempty"`
	// Items: Representation of the TaskResultSummary or TaskRunResult ndb model.
	Items []*SwarmingRpcsTaskResult `json:"items,omitempty"`
	Now   string                    `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBotTasks) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBotTasks
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsBotsCount: Returns the count, as requested.
type SwarmingRpcsBotsCount struct {
	Busy        int64  `json:"busy,omitempty,string"`
	Count       int64  `json:"count,omitempty,string"`
	Dead        int64  `json:"dead,omitempty,string"`
	Maintenance int64  `json:"maintenance,omitempty,string"`
	Now         string `json:"now,omitempty"`
	Quarantined int64  `json:"quarantined,omitempty,string"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Busy") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Busy") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBotsCount) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBotsCount
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsBotsDimensions: Returns all the dimensions and dimension
// possibilities in the fleet.
type SwarmingRpcsBotsDimensions struct {
	// BotsDimensions: Represents a mapping of string to list of strings.
	BotsDimensions []*SwarmingRpcsStringListPair `json:"bots_dimensions,omitempty"`
	Ts             string                        `json:"ts,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "BotsDimensions") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BotsDimensions") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsBotsDimensions) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsBotsDimensions
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsCASOperationStats struct {
	Duration            float64 `json:"duration,omitempty"`
	InitialNumberItems  int64   `json:"initial_number_items,omitempty,string"`
	InitialSize         int64   `json:"initial_size,omitempty,string"`
	ItemsCold           string  `json:"items_cold,omitempty"`
	ItemsHot            string  `json:"items_hot,omitempty"`
	NumItemsCold        int64   `json:"num_items_cold,omitempty,string"`
	NumItemsHot         int64   `json:"num_items_hot,omitempty,string"`
	TotalBytesItemsCold int64   `json:"total_bytes_items_cold,omitempty,string"`
	TotalBytesItemsHot  int64   `json:"total_bytes_items_hot,omitempty,string"`
	// ForceSendFields is a list of field names (e.g. "Duration") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Duration") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsCASOperationStats) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsCASOperationStats
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

func (s *SwarmingRpcsCASOperationStats) UnmarshalJSON(data []byte) error {
	type NoMethod SwarmingRpcsCASOperationStats
	var s1 struct {
		Duration gensupport.JSONFloat64 `json:"duration"`
		*NoMethod
	}
	s1.NoMethod = (*NoMethod)(s)
	if err := json.Unmarshal(data, &s1); err != nil {
		return err
	}
	s.Duration = float64(s1.Duration)
	return nil
}

type SwarmingRpcsCASReference struct {
	CasInstance string              `json:"cas_instance,omitempty"`
	Digest      *SwarmingRpcsDigest `json:"digest,omitempty"`
	// ForceSendFields is a list of field names (e.g. "CasInstance") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CasInstance") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsCASReference) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsCASReference
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsCacheEntry: Describes a named cache that should be present on
// the bot. A CacheEntry in a task specified that the task prefers the cache to
// be present on the bot. A symlink to the cache directory is created at
// <run_dir>/|path|. If cache is not present on the machine, the directory is
// empty. If the tasks makes any changes to the contents of the cache
// directory, they are persisted on the machine. If another task runs on the
// same machine and requests the same named cache, even if mapped to a
// different path, it will see the changes.
type SwarmingRpcsCacheEntry struct {
	Name string `json:"name,omitempty"`
	Path string `json:"path,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Name") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsCacheEntry) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsCacheEntry
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsCancelResponse: Result of a request to cancel a task.
type SwarmingRpcsCancelResponse struct {
	Ok         bool `json:"ok,omitempty"`
	WasRunning bool `json:"was_running,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Ok") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Ok") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsCancelResponse) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsCancelResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsCipdInput: Defines CIPD packages to install in task run
// directory.
type SwarmingRpcsCipdInput struct {
	// ClientPackage: A CIPD package to install in the run dir before task
	// execution.
	ClientPackage *SwarmingRpcsCipdPackage `json:"client_package,omitempty"`
	// Packages: A CIPD package to install in the run dir before task execution.
	Packages []*SwarmingRpcsCipdPackage `json:"packages,omitempty"`
	Server   string                     `json:"server,omitempty"`
	// ForceSendFields is a list of field names (e.g. "ClientPackage") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ClientPackage") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsCipdInput) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsCipdInput
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsCipdPackage: A CIPD package to install in the run dir before
// task execution.
type SwarmingRpcsCipdPackage struct {
	PackageName string `json:"package_name,omitempty"`
	Path        string `json:"path,omitempty"`
	Version     string `json:"version,omitempty"`
	// ForceSendFields is a list of field names (e.g. "PackageName") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "PackageName") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsCipdPackage) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsCipdPackage
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsCipdPins: Defines pinned CIPD packages that were installed
// during the task.
type SwarmingRpcsCipdPins struct {
	// ClientPackage: A CIPD package to install in the run dir before task
	// execution.
	ClientPackage *SwarmingRpcsCipdPackage `json:"client_package,omitempty"`
	// Packages: A CIPD package to install in the run dir before task execution.
	Packages []*SwarmingRpcsCipdPackage `json:"packages,omitempty"`
	// ForceSendFields is a list of field names (e.g. "ClientPackage") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ClientPackage") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsCipdPins) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsCipdPins
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsClientPermissions: Reports the client's permissions.
type SwarmingRpcsClientPermissions struct {
	CancelTask        bool     `json:"cancel_task,omitempty"`
	CancelTasks       bool     `json:"cancel_tasks,omitempty"`
	DeleteBot         bool     `json:"delete_bot,omitempty"`
	DeleteBots        bool     `json:"delete_bots,omitempty"`
	GetBootstrapToken bool     `json:"get_bootstrap_token,omitempty"`
	GetConfigs        bool     `json:"get_configs,omitempty"`
	ListBots          []string `json:"list_bots,omitempty"`
	ListTasks         []string `json:"list_tasks,omitempty"`
	PutConfigs        bool     `json:"put_configs,omitempty"`
	TerminateBot      bool     `json:"terminate_bot,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "CancelTask") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CancelTask") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsClientPermissions) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsClientPermissions
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsContainment: See proto/api/swarming.proto for description.
type SwarmingRpcsContainment struct {
	// Possible values:
	//   "AUTO"
	//   "JOB_OBJECT"
	//   "NONE"
	//   "NOT_SPECIFIED"
	ContainmentType string `json:"containment_type,omitempty"`
	// ForceSendFields is a list of field names (e.g. "ContainmentType") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ContainmentType") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsContainment) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsContainment
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsDeletedResponse: Indicates whether a bot was deleted.
type SwarmingRpcsDeletedResponse struct {
	Deleted bool `json:"deleted,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Deleted") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Deleted") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsDeletedResponse) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsDeletedResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsDigest struct {
	Hash      string `json:"hash,omitempty"`
	SizeBytes int64  `json:"size_bytes,omitempty,string"`
	// ForceSendFields is a list of field names (e.g. "Hash") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Hash") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsDigest) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsDigest
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsFileContent: Content of a file.
type SwarmingRpcsFileContent struct {
	Content string `json:"content,omitempty"`
	Version string `json:"version,omitempty"`
	When    string `json:"when,omitempty"`
	Who     string `json:"who,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Content") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Content") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsFileContent) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsFileContent
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsNewTaskRequest: Description of a new task request as described
// by the client. This message is used to create a new task.
type SwarmingRpcsNewTaskRequest struct {
	BotPingToleranceSecs int64  `json:"bot_ping_tolerance_secs,omitempty,string"`
	EvaluateOnly         bool   `json:"evaluate_only,omitempty"`
	ExpirationSecs       int64  `json:"expiration_secs,omitempty,string"`
	Name                 string `json:"name,omitempty"`
	ParentTaskId         string `json:"parent_task_id,omitempty"`
	// Possible values:
	//   "AUTO" (default)
	//   "CANARY_NEVER"
	//   "CANARY_PREFER"
	//   "SKIP"
	PoolTaskTemplate string `json:"pool_task_template,omitempty"`
	Priority         int64  `json:"priority,omitempty,string"`
	// Properties: Important metadata about a particular task.
	Properties      *SwarmingRpcsTaskProperties `json:"properties,omitempty"`
	PubsubAuthToken string                      `json:"pubsub_auth_token,omitempty"`
	PubsubTopic     string                      `json:"pubsub_topic,omitempty"`
	PubsubUserdata  string                      `json:"pubsub_userdata,omitempty"`
	Realm           string                      `json:"realm,omitempty"`
	RequestUuid     string                      `json:"request_uuid,omitempty"`
	// Resultdb: Swarming:ResultDB integration configuration for a task. See
	// NewTaskRequest.resultdb for more details.
	Resultdb       *SwarmingRpcsResultDBCfg `json:"resultdb,omitempty"`
	ServiceAccount string                   `json:"service_account,omitempty"`
	Tags           []string                 `json:"tags,omitempty"`
	// TaskSlices: Defines a possible task execution for a task request to be run
	// on the Swarming infrastructure. This is one of the possible fallback on a
	// task request.
	TaskSlices []*SwarmingRpcsTaskSlice `json:"task_slices,omitempty"`
	User       string                   `json:"user,omitempty"`
	// ForceSendFields is a list of field names (e.g. "BotPingToleranceSecs") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BotPingToleranceSecs") to include
	// in API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsNewTaskRequest) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsNewTaskRequest
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsOperationStats struct {
	Duration float64 `json:"duration,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Duration") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Duration") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsOperationStats) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsOperationStats
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

func (s *SwarmingRpcsOperationStats) UnmarshalJSON(data []byte) error {
	type NoMethod SwarmingRpcsOperationStats
	var s1 struct {
		Duration gensupport.JSONFloat64 `json:"duration"`
		*NoMethod
	}
	s1.NoMethod = (*NoMethod)(s)
	if err := json.Unmarshal(data, &s1); err != nil {
		return err
	}
	s.Duration = float64(s1.Duration)
	return nil
}

// SwarmingRpcsPerformanceStats: Performance stats of task execution. See
// task_result.PerformanceStats for details.
type SwarmingRpcsPerformanceStats struct {
	BotOverhead          float64                        `json:"bot_overhead,omitempty"`
	CacheTrim            *SwarmingRpcsOperationStats    `json:"cache_trim,omitempty"`
	Cleanup              *SwarmingRpcsOperationStats    `json:"cleanup,omitempty"`
	IsolatedDownload     *SwarmingRpcsCASOperationStats `json:"isolated_download,omitempty"`
	IsolatedUpload       *SwarmingRpcsCASOperationStats `json:"isolated_upload,omitempty"`
	NamedCachesInstall   *SwarmingRpcsOperationStats    `json:"named_caches_install,omitempty"`
	NamedCachesUninstall *SwarmingRpcsOperationStats    `json:"named_caches_uninstall,omitempty"`
	PackageInstallation  *SwarmingRpcsOperationStats    `json:"package_installation,omitempty"`
	// ForceSendFields is a list of field names (e.g. "BotOverhead") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BotOverhead") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsPerformanceStats) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsPerformanceStats
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

func (s *SwarmingRpcsPerformanceStats) UnmarshalJSON(data []byte) error {
	type NoMethod SwarmingRpcsPerformanceStats
	var s1 struct {
		BotOverhead gensupport.JSONFloat64 `json:"bot_overhead"`
		*NoMethod
	}
	s1.NoMethod = (*NoMethod)(s)
	if err := json.Unmarshal(data, &s1); err != nil {
		return err
	}
	s.BotOverhead = float64(s1.BotOverhead)
	return nil
}

// SwarmingRpcsResultDBCfg: Swarming:ResultDB integration configuration for a
// task. See NewTaskRequest.resultdb for more details.
type SwarmingRpcsResultDBCfg struct {
	Enable bool `json:"enable,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Enable") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Enable") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsResultDBCfg) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsResultDBCfg
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsResultDBInfo: ResultDB related properties.
type SwarmingRpcsResultDBInfo struct {
	Hostname   string `json:"hostname,omitempty"`
	Invocation string `json:"invocation,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Hostname") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Hostname") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsResultDBInfo) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsResultDBInfo
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsServerDetails: Reports details about the server.
type SwarmingRpcsServerDetails struct {
	BotVersion               string `json:"bot_version,omitempty"`
	CasViewerServer          string `json:"cas_viewer_server,omitempty"`
	DisplayServerUrlTemplate string `json:"display_server_url_template,omitempty"`
	LuciConfig               string `json:"luci_config,omitempty"`
	MachineProviderTemplate  string `json:"machine_provider_template,omitempty"`
	ServerVersion            string `json:"server_version,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "BotVersion") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BotVersion") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsServerDetails) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsServerDetails
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsStringListPair: Represents a mapping of string to list of
// strings.
type SwarmingRpcsStringListPair struct {
	Key   string   `json:"key,omitempty"`
	Value []string `json:"value,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Key") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Key") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsStringListPair) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsStringListPair
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsStringPair: Represents a mapping of string to string.
type SwarmingRpcsStringPair struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Key") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Key") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsStringPair) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsStringPair
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskCancelRequest: Request to cancel one task.
type SwarmingRpcsTaskCancelRequest struct {
	KillRunning bool `json:"kill_running,omitempty"`
	// ForceSendFields is a list of field names (e.g. "KillRunning") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "KillRunning") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskCancelRequest) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskCancelRequest
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskList: Wraps a list of TaskResult.
type SwarmingRpcsTaskList struct {
	Cursor string `json:"cursor,omitempty"`
	// Items: Representation of the TaskResultSummary or TaskRunResult ndb model.
	Items []*SwarmingRpcsTaskResult `json:"items,omitempty"`
	Now   string                    `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskList) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskList
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskOutput: A task's output as a string.
type SwarmingRpcsTaskOutput struct {
	Output string `json:"output,omitempty"`
	// Possible values:
	//   "BOT_DIED"
	//   "CANCELED"
	//   "CLIENT_ERROR"
	//   "COMPLETED"
	//   "EXPIRED"
	//   "INVALID"
	//   "KILLED"
	//   "NO_RESOURCE"
	//   "PENDING"
	//   "RUNNING"
	//   "TIMED_OUT"
	State string `json:"state,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Output") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Output") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskOutput) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskOutput
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskProperties: Important metadata about a particular task.
type SwarmingRpcsTaskProperties struct {
	// Caches: Describes a named cache that should be present on the bot. A
	// CacheEntry in a task specified that the task prefers the cache to be present
	// on the bot. A symlink to the cache directory is created at <run_dir>/|path|.
	// If cache is not present on the machine, the directory is empty. If the tasks
	// makes any changes to the contents of the cache directory, they are persisted
	// on the machine. If another task runs on the same machine and requests the
	// same named cache, even if mapped to a different path, it will see the
	// changes.
	Caches       []*SwarmingRpcsCacheEntry `json:"caches,omitempty"`
	CasInputRoot *SwarmingRpcsCASReference `json:"cas_input_root,omitempty"`
	// CipdInput: Defines CIPD packages to install in task run directory.
	CipdInput *SwarmingRpcsCipdInput `json:"cipd_input,omitempty"`
	Command   []string               `json:"command,omitempty"`
	// Containment: See proto/api/swarming.proto for description.
	Containment *SwarmingRpcsContainment `json:"containment,omitempty"`
	// Dimensions: Represents a mapping of string to string.
	Dimensions []*SwarmingRpcsStringPair `json:"dimensions,omitempty"`
	// Env: Represents a mapping of string to string.
	Env []*SwarmingRpcsStringPair `json:"env,omitempty"`
	// EnvPrefixes: Represents a mapping of string to list of strings.
	EnvPrefixes          []*SwarmingRpcsStringListPair `json:"env_prefixes,omitempty"`
	ExecutionTimeoutSecs int64                         `json:"execution_timeout_secs,omitempty,string"`
	GracePeriodSecs      int64                         `json:"grace_period_secs,omitempty,string"`
	Idempotent           bool                          `json:"idempotent,omitempty"`
	IoTimeoutSecs        int64                         `json:"io_timeout_secs,omitempty,string"`
	Outputs              []string                      `json:"outputs,omitempty"`
	RelativeCwd          string                        `json:"relative_cwd,omitempty"`
	SecretBytes          string                        `json:"secret_bytes,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Caches") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Caches") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskProperties) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskProperties
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsTaskQueue struct {
	Dimensions   []string `json:"dimensions,omitempty"`
	ValidUntilTs string   `json:"valid_until_ts,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Dimensions") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Dimensions") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskQueue) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskQueue
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type SwarmingRpcsTaskQueueList struct {
	Cursor string                   `json:"cursor,omitempty"`
	Items  []*SwarmingRpcsTaskQueue `json:"items,omitempty"`
	Now    string                   `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskQueueList) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskQueueList
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskRequest: Description of a task request as registered by the
// server. This message is used when retrieving information about an existing
// task. See NewTaskRequest for more details.
type SwarmingRpcsTaskRequest struct {
	Authenticated        string `json:"authenticated,omitempty"`
	BotPingToleranceSecs int64  `json:"bot_ping_tolerance_secs,omitempty,string"`
	CreatedTs            string `json:"created_ts,omitempty"`
	ExpirationSecs       int64  `json:"expiration_secs,omitempty,string"`
	Name                 string `json:"name,omitempty"`
	ParentTaskId         string `json:"parent_task_id,omitempty"`
	Priority             int64  `json:"priority,omitempty,string"`
	// Properties: Important metadata about a particular task.
	Properties     *SwarmingRpcsTaskProperties `json:"properties,omitempty"`
	PubsubTopic    string                      `json:"pubsub_topic,omitempty"`
	PubsubUserdata string                      `json:"pubsub_userdata,omitempty"`
	RbeInstance    string                      `json:"rbe_instance,omitempty"`
	Realm          string                      `json:"realm,omitempty"`
	// Resultdb: Swarming:ResultDB integration configuration for a task. See
	// NewTaskRequest.resultdb for more details.
	Resultdb       *SwarmingRpcsResultDBCfg `json:"resultdb,omitempty"`
	ServiceAccount string                   `json:"service_account,omitempty"`
	Tags           []string                 `json:"tags,omitempty"`
	TaskId         string                   `json:"task_id,omitempty"`
	// TaskSlices: Defines a possible task execution for a task request to be run
	// on the Swarming infrastructure. This is one of the possible fallback on a
	// task request.
	TaskSlices []*SwarmingRpcsTaskSlice `json:"task_slices,omitempty"`
	User       string                   `json:"user,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Authenticated") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Authenticated") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskRequest) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskRequest
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskRequestMetadata: Provides the ID of the requested
// TaskRequest.
type SwarmingRpcsTaskRequestMetadata struct {
	// Request: Description of a task request as registered by the server. This
	// message is used when retrieving information about an existing task. See
	// NewTaskRequest for more details.
	Request *SwarmingRpcsTaskRequest `json:"request,omitempty"`
	TaskId  string                   `json:"task_id,omitempty"`
	// TaskResult: Representation of the TaskResultSummary or TaskRunResult ndb
	// model.
	TaskResult *SwarmingRpcsTaskResult `json:"task_result,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Request") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Request") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskRequestMetadata) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskRequestMetadata
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskRequests: Wraps a list of TaskRequest.
type SwarmingRpcsTaskRequests struct {
	Cursor string `json:"cursor,omitempty"`
	// Items: Description of a task request as registered by the server. This
	// message is used when retrieving information about an existing task. See
	// NewTaskRequest for more details.
	Items []*SwarmingRpcsTaskRequest `json:"items,omitempty"`
	Now   string                     `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskRequests) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskRequests
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskResult: Representation of the TaskResultSummary or
// TaskRunResult ndb model.
type SwarmingRpcsTaskResult struct {
	AbandonedTs string `json:"abandoned_ts,omitempty"`
	// BotDimensions: Represents a mapping of string to list of strings.
	BotDimensions       []*SwarmingRpcsStringListPair `json:"bot_dimensions,omitempty"`
	BotId               string                        `json:"bot_id,omitempty"`
	BotIdleSinceTs      string                        `json:"bot_idle_since_ts,omitempty"`
	BotLogsCloudProject string                        `json:"bot_logs_cloud_project,omitempty"`
	BotVersion          string                        `json:"bot_version,omitempty"`
	CasOutputRoot       *SwarmingRpcsCASReference     `json:"cas_output_root,omitempty"`
	// CipdPins: Defines pinned CIPD packages that were installed during the task.
	CipdPins         *SwarmingRpcsCipdPins       `json:"cipd_pins,omitempty"`
	CompletedTs      string                      `json:"completed_ts,omitempty"`
	CostSavedUsd     float64                     `json:"cost_saved_usd,omitempty"`
	CostsUsd         []float64                   `json:"costs_usd,omitempty"`
	CreatedTs        string                      `json:"created_ts,omitempty"`
	CurrentTaskSlice int64                       `json:"current_task_slice,omitempty,string"`
	DedupedFrom      string                      `json:"deduped_from,omitempty"`
	Duration         float64                     `json:"duration,omitempty"`
	ExitCode         int64                       `json:"exit_code,omitempty,string"`
	Failure          bool                        `json:"failure,omitempty"`
	InternalFailure  bool                        `json:"internal_failure,omitempty"`
	MissingCas       []*SwarmingRpcsCASReference `json:"missing_cas,omitempty"`
	// MissingCipd: A CIPD package to install in the run dir before task execution.
	MissingCipd []*SwarmingRpcsCipdPackage `json:"missing_cipd,omitempty"`
	ModifiedTs  string                     `json:"modified_ts,omitempty"`
	Name        string                     `json:"name,omitempty"`
	// PerformanceStats: Performance stats of task execution. See
	// task_result.PerformanceStats for details.
	PerformanceStats *SwarmingRpcsPerformanceStats `json:"performance_stats,omitempty"`
	// ResultdbInfo: ResultDB related properties.
	ResultdbInfo   *SwarmingRpcsResultDBInfo `json:"resultdb_info,omitempty"`
	RunId          string                    `json:"run_id,omitempty"`
	ServerVersions []string                  `json:"server_versions,omitempty"`
	StartedTs      string                    `json:"started_ts,omitempty"`
	// Possible values:
	//   "BOT_DIED"
	//   "CANCELED"
	//   "CLIENT_ERROR"
	//   "COMPLETED"
	//   "EXPIRED"
	//   "INVALID"
	//   "KILLED"
	//   "NO_RESOURCE"
	//   "PENDING"
	//   "RUNNING"
	//   "TIMED_OUT"
	State  string   `json:"state,omitempty"`
	Tags   []string `json:"tags,omitempty"`
	TaskId string   `json:"task_id,omitempty"`
	User   string   `json:"user,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "AbandonedTs") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "AbandonedTs") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskResult) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskResult
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

func (s *SwarmingRpcsTaskResult) UnmarshalJSON(data []byte) error {
	type NoMethod SwarmingRpcsTaskResult
	var s1 struct {
		CostSavedUsd gensupport.JSONFloat64   `json:"cost_saved_usd"`
		CostsUsd     []gensupport.JSONFloat64 `json:"costs_usd"`
		Duration     gensupport.JSONFloat64   `json:"duration"`
		*NoMethod
	}
	s1.NoMethod = (*NoMethod)(s)
	if err := json.Unmarshal(data, &s1); err != nil {
		return err
	}
	s.CostSavedUsd = float64(s1.CostSavedUsd)
	s.CostsUsd = make([]float64, len(s1.CostsUsd))
	for i := range s1.CostsUsd {
		s.CostsUsd[i] = float64(s1.CostsUsd[i])
	}
	s.Duration = float64(s1.Duration)
	return nil
}

// SwarmingRpcsTaskSlice: Defines a possible task execution for a task request
// to be run on the Swarming infrastructure. This is one of the possible
// fallback on a task request.
type SwarmingRpcsTaskSlice struct {
	ExpirationSecs int64 `json:"expiration_secs,omitempty,string"`
	// Properties: Important metadata about a particular task.
	Properties      *SwarmingRpcsTaskProperties `json:"properties,omitempty"`
	WaitForCapacity bool                        `json:"wait_for_capacity,omitempty"`
	// ForceSendFields is a list of field names (e.g. "ExpirationSecs") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ExpirationSecs") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskSlice) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskSlice
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTaskStates: Only holds states. Used in the 'get_states' RPC.
type SwarmingRpcsTaskStates struct {
	// Possible values:
	//   "BOT_DIED"
	//   "CANCELED"
	//   "CLIENT_ERROR"
	//   "COMPLETED"
	//   "EXPIRED"
	//   "INVALID"
	//   "KILLED"
	//   "NO_RESOURCE"
	//   "PENDING"
	//   "RUNNING"
	//   "TIMED_OUT"
	States []string `json:"states,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "States") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "States") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTaskStates) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTaskStates
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTasksCancelRequest: Request to cancel some subset of
// pending/running tasks.
type SwarmingRpcsTasksCancelRequest struct {
	Cursor      string  `json:"cursor,omitempty"`
	End         float64 `json:"end,omitempty"`
	KillRunning bool    `json:"kill_running,omitempty"`
	// Default: 100
	Limit *int64   `json:"limit,omitempty,string"`
	Start float64  `json:"start,omitempty"`
	Tags  []string `json:"tags,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTasksCancelRequest) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTasksCancelRequest
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

func (s *SwarmingRpcsTasksCancelRequest) UnmarshalJSON(data []byte) error {
	type NoMethod SwarmingRpcsTasksCancelRequest
	var s1 struct {
		End   gensupport.JSONFloat64 `json:"end"`
		Start gensupport.JSONFloat64 `json:"start"`
		*NoMethod
	}
	s1.NoMethod = (*NoMethod)(s)
	if err := json.Unmarshal(data, &s1); err != nil {
		return err
	}
	s.End = float64(s1.End)
	s.Start = float64(s1.Start)
	return nil
}

// SwarmingRpcsTasksCancelResponse: Result of canceling some subset of pending
// tasks.
type SwarmingRpcsTasksCancelResponse struct {
	Cursor  string `json:"cursor,omitempty"`
	Matched int64  `json:"matched,omitempty,string"`
	Now     string `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Cursor") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Cursor") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTasksCancelResponse) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTasksCancelResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTasksCount: Returns the count, as requested.
type SwarmingRpcsTasksCount struct {
	Count int64  `json:"count,omitempty,string"`
	Now   string `json:"now,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Count") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Count") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTasksCount) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTasksCount
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// SwarmingRpcsTerminateResponse: Returns the pseudo taskid to wait for the bot
// to shut down.
type SwarmingRpcsTerminateResponse struct {
	TaskId string `json:"task_id,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "TaskId") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "TaskId") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s SwarmingRpcsTerminateResponse) MarshalJSON() ([]byte, error) {
	type NoMethod SwarmingRpcsTerminateResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type BotDeleteCall struct {
	s          *Service
	botId      string
	urlParams_ gensupport.URLParams
	ctx_       context.Context
	header_    http.Header
}

// Delete: Deletes the bot corresponding to a provided bot_id. At that point,
// the bot will not appears in the list of bots but it is still possible to get
// information about the bot with its bot id is known, as historical data is
// not deleted. It is meant to remove from the DB the presence of a bot that
// was retired, e.g. the VM was shut down already. Use 'terminate' instead of
// the bot is still alive.
//
// - botId: .
func (r *BotService) Delete(botId string) *BotDeleteCall {
	c := &BotDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.botId = botId
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotDeleteCall) Fields(s ...googleapi.Field) *BotDeleteCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotDeleteCall) Context(ctx context.Context) *BotDeleteCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotDeleteCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotDeleteCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bot/{bot_id}/delete")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"bot_id": c.botId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bot.delete", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bot.delete" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsDeletedResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *BotDeleteCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsDeletedResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsDeletedResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bot.delete", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type BotEventsCall struct {
	s            *Service
	botId        string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Events: Returns events that happened on a bot.
//
// - botId: .
func (r *BotService) Events(botId string) *BotEventsCall {
	c := &BotEventsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.botId = botId
	return c
}

// Cursor sets the optional parameter "cursor":
func (c *BotEventsCall) Cursor(cursor string) *BotEventsCall {
	c.urlParams_.Set("cursor", cursor)
	return c
}

// End sets the optional parameter "end":
func (c *BotEventsCall) End(end float64) *BotEventsCall {
	c.urlParams_.Set("end", fmt.Sprint(end))
	return c
}

// Limit sets the optional parameter "limit":
func (c *BotEventsCall) Limit(limit int64) *BotEventsCall {
	c.urlParams_.Set("limit", fmt.Sprint(limit))
	return c
}

// Start sets the optional parameter "start":
func (c *BotEventsCall) Start(start float64) *BotEventsCall {
	c.urlParams_.Set("start", fmt.Sprint(start))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotEventsCall) Fields(s ...googleapi.Field) *BotEventsCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *BotEventsCall) IfNoneMatch(entityTag string) *BotEventsCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotEventsCall) Context(ctx context.Context) *BotEventsCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotEventsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotEventsCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bot/{bot_id}/events")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"bot_id": c.botId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bot.events", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bot.events" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsBotEvents.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *BotEventsCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsBotEvents, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsBotEvents{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bot.events", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type BotGetCall struct {
	s            *Service
	botId        string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Get: Returns information about a known bot. This includes its state and
// dimensions, and if it is currently running a task.
//
// - botId: .
func (r *BotService) Get(botId string) *BotGetCall {
	c := &BotGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.botId = botId
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotGetCall) Fields(s ...googleapi.Field) *BotGetCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *BotGetCall) IfNoneMatch(entityTag string) *BotGetCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotGetCall) Context(ctx context.Context) *BotGetCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotGetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotGetCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bot/{bot_id}/get")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"bot_id": c.botId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bot.get", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bot.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsBotInfo.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *BotGetCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsBotInfo, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsBotInfo{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bot.get", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type BotTasksCall struct {
	s            *Service
	botId        string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Tasks: Lists a given bot's tasks within the specified date range. In this
// case, the tasks are effectively TaskRunResult since it's individual task
// tries sent to this specific bot. It is impossible to search by both tags and
// bot id. If there's a need, TaskRunResult.tags will be added (via a copy from
// TaskRequest.tags).
//
// - botId: .
func (r *BotService) Tasks(botId string) *BotTasksCall {
	c := &BotTasksCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.botId = botId
	return c
}

// Cursor sets the optional parameter "cursor":
func (c *BotTasksCall) Cursor(cursor string) *BotTasksCall {
	c.urlParams_.Set("cursor", cursor)
	return c
}

// End sets the optional parameter "end":
func (c *BotTasksCall) End(end float64) *BotTasksCall {
	c.urlParams_.Set("end", fmt.Sprint(end))
	return c
}

// IncludePerformanceStats sets the optional parameter
// "include_performance_stats":
func (c *BotTasksCall) IncludePerformanceStats(includePerformanceStats bool) *BotTasksCall {
	c.urlParams_.Set("include_performance_stats", fmt.Sprint(includePerformanceStats))
	return c
}

// Limit sets the optional parameter "limit":
func (c *BotTasksCall) Limit(limit int64) *BotTasksCall {
	c.urlParams_.Set("limit", fmt.Sprint(limit))
	return c
}

// Sort sets the optional parameter "sort":
//
// Possible values:
//
//	"ABANDONED_TS"
//	"COMPLETED_TS"
//	"CREATED_TS" (default)
//	"STARTED_TS"
func (c *BotTasksCall) Sort(sort string) *BotTasksCall {
	c.urlParams_.Set("sort", sort)
	return c
}

// Start sets the optional parameter "start":
func (c *BotTasksCall) Start(start float64) *BotTasksCall {
	c.urlParams_.Set("start", fmt.Sprint(start))
	return c
}

// State sets the optional parameter "state":
//
// Possible values:
//
//	"ALL" (default)
//	"BOT_DIED"
//	"CANCELED"
//	"CLIENT_ERROR"
//	"COMPLETED"
//	"COMPLETED_FAILURE"
//	"COMPLETED_SUCCESS"
//	"DEDUPED"
//	"EXPIRED"
//	"KILLED"
//	"NO_RESOURCE"
//	"PENDING"
//	"PENDING_RUNNING"
//	"RUNNING"
//	"TIMED_OUT"
func (c *BotTasksCall) State(state string) *BotTasksCall {
	c.urlParams_.Set("state", state)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotTasksCall) Fields(s ...googleapi.Field) *BotTasksCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *BotTasksCall) IfNoneMatch(entityTag string) *BotTasksCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotTasksCall) Context(ctx context.Context) *BotTasksCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotTasksCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotTasksCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bot/{bot_id}/tasks")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"bot_id": c.botId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bot.tasks", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bot.tasks" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsBotTasks.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *BotTasksCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsBotTasks, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsBotTasks{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bot.tasks", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type BotTerminateCall struct {
	s          *Service
	botId      string
	urlParams_ gensupport.URLParams
	ctx_       context.Context
	header_    http.Header
}

// Terminate: Asks a bot to terminate itself gracefully. The bot will stay in
// the DB, use 'delete' to remove it from the DB afterward. This request
// returns a pseudo-taskid that can be waited for to wait for the bot to turn
// down. This command is particularly useful when a privileged user needs to
// safely debug a machine specific issue. The user can trigger a terminate for
// one of the bot exhibiting the issue, wait for the pseudo-task to run then
// access the machine with the guarantee that the bot is not running anymore.
//
// - botId: .
func (r *BotService) Terminate(botId string) *BotTerminateCall {
	c := &BotTerminateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.botId = botId
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotTerminateCall) Fields(s ...googleapi.Field) *BotTerminateCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotTerminateCall) Context(ctx context.Context) *BotTerminateCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotTerminateCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotTerminateCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bot/{bot_id}/terminate")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"bot_id": c.botId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bot.terminate", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bot.terminate" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTerminateResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *BotTerminateCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTerminateResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTerminateResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bot.terminate", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type BotsCountCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Count: Counts number of bots with given dimensions.
func (r *BotsService) Count() *BotsCountCall {
	c := &BotsCountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Dimensions sets the optional parameter "dimensions":
func (c *BotsCountCall) Dimensions(dimensions ...string) *BotsCountCall {
	c.urlParams_.SetMulti("dimensions", append([]string{}, dimensions...))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotsCountCall) Fields(s ...googleapi.Field) *BotsCountCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *BotsCountCall) IfNoneMatch(entityTag string) *BotsCountCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotsCountCall) Context(ctx context.Context) *BotsCountCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotsCountCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotsCountCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bots/count")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bots.count", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bots.count" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsBotsCount.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *BotsCountCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsBotsCount, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsBotsCount{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bots.count", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type BotsDimensionsCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Dimensions: Returns the cached set of dimensions currently in use in the
// fleet.
func (r *BotsService) Dimensions() *BotsDimensionsCall {
	c := &BotsDimensionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Pool sets the optional parameter "pool":
func (c *BotsDimensionsCall) Pool(pool string) *BotsDimensionsCall {
	c.urlParams_.Set("pool", pool)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotsDimensionsCall) Fields(s ...googleapi.Field) *BotsDimensionsCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *BotsDimensionsCall) IfNoneMatch(entityTag string) *BotsDimensionsCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotsDimensionsCall) Context(ctx context.Context) *BotsDimensionsCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotsDimensionsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotsDimensionsCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bots/dimensions")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bots.dimensions", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bots.dimensions" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsBotsDimensions.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *BotsDimensionsCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsBotsDimensions, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsBotsDimensions{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bots.dimensions", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type BotsListCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// List: Provides list of known bots. Deleted bots will not be listed.
func (r *BotsService) List() *BotsListCall {
	c := &BotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Cursor sets the optional parameter "cursor":
func (c *BotsListCall) Cursor(cursor string) *BotsListCall {
	c.urlParams_.Set("cursor", cursor)
	return c
}

// Dimensions sets the optional parameter "dimensions":
func (c *BotsListCall) Dimensions(dimensions ...string) *BotsListCall {
	c.urlParams_.SetMulti("dimensions", append([]string{}, dimensions...))
	return c
}

// InMaintenance sets the optional parameter "in_maintenance":
//
// Possible values:
//
//	"FALSE"
//	"NONE" (default)
//	"TRUE"
func (c *BotsListCall) InMaintenance(inMaintenance string) *BotsListCall {
	c.urlParams_.Set("in_maintenance", inMaintenance)
	return c
}

// IsBusy sets the optional parameter "is_busy":
//
// Possible values:
//
//	"FALSE"
//	"NONE" (default)
//	"TRUE"
func (c *BotsListCall) IsBusy(isBusy string) *BotsListCall {
	c.urlParams_.Set("is_busy", isBusy)
	return c
}

// IsDead sets the optional parameter "is_dead":
//
// Possible values:
//
//	"FALSE"
//	"NONE" (default)
//	"TRUE"
func (c *BotsListCall) IsDead(isDead string) *BotsListCall {
	c.urlParams_.Set("is_dead", isDead)
	return c
}

// Limit sets the optional parameter "limit":
func (c *BotsListCall) Limit(limit int64) *BotsListCall {
	c.urlParams_.Set("limit", fmt.Sprint(limit))
	return c
}

// Quarantined sets the optional parameter "quarantined":
//
// Possible values:
//
//	"FALSE"
//	"NONE" (default)
//	"TRUE"
func (c *BotsListCall) Quarantined(quarantined string) *BotsListCall {
	c.urlParams_.Set("quarantined", quarantined)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *BotsListCall) Fields(s ...googleapi.Field) *BotsListCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *BotsListCall) IfNoneMatch(entityTag string) *BotsListCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *BotsListCall) Context(ctx context.Context) *BotsListCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *BotsListCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *BotsListCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "bots/list")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.bots.list", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.bots.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsBotList.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *BotsListCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsBotList, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsBotList{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.bots.list", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type QueuesListCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// List:
func (r *QueuesService) List() *QueuesListCall {
	c := &QueuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Cursor sets the optional parameter "cursor":
func (c *QueuesListCall) Cursor(cursor string) *QueuesListCall {
	c.urlParams_.Set("cursor", cursor)
	return c
}

// Limit sets the optional parameter "limit":
func (c *QueuesListCall) Limit(limit int64) *QueuesListCall {
	c.urlParams_.Set("limit", fmt.Sprint(limit))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *QueuesListCall) Fields(s ...googleapi.Field) *QueuesListCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *QueuesListCall) IfNoneMatch(entityTag string) *QueuesListCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *QueuesListCall) Context(ctx context.Context) *QueuesListCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *QueuesListCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *QueuesListCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "queues/list")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.queues.list", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.queues.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskQueueList.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *QueuesListCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskQueueList, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskQueueList{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.queues.list", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type ServerDetailsCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Details: Returns information about the server.
func (r *ServerService) Details() *ServerDetailsCall {
	c := &ServerDetailsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ServerDetailsCall) Fields(s ...googleapi.Field) *ServerDetailsCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ServerDetailsCall) IfNoneMatch(entityTag string) *ServerDetailsCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ServerDetailsCall) Context(ctx context.Context) *ServerDetailsCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ServerDetailsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ServerDetailsCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "server/details")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.server.details", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.server.details" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsServerDetails.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServerDetailsCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsServerDetails, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsServerDetails{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.server.details", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type ServerGetBootstrapCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// GetBootstrap: Retrieves the current version of bootstrap.py.
func (r *ServerService) GetBootstrap() *ServerGetBootstrapCall {
	c := &ServerGetBootstrapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ServerGetBootstrapCall) Fields(s ...googleapi.Field) *ServerGetBootstrapCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ServerGetBootstrapCall) IfNoneMatch(entityTag string) *ServerGetBootstrapCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ServerGetBootstrapCall) Context(ctx context.Context) *ServerGetBootstrapCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ServerGetBootstrapCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ServerGetBootstrapCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "server/get_bootstrap")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.server.get_bootstrap", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.server.get_bootstrap" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsFileContent.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServerGetBootstrapCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsFileContent, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsFileContent{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.server.get_bootstrap", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type ServerGetBotConfigCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// GetBotConfig: Retrieves the current version of bot_config.py.
func (r *ServerService) GetBotConfig() *ServerGetBotConfigCall {
	c := &ServerGetBotConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ServerGetBotConfigCall) Fields(s ...googleapi.Field) *ServerGetBotConfigCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ServerGetBotConfigCall) IfNoneMatch(entityTag string) *ServerGetBotConfigCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ServerGetBotConfigCall) Context(ctx context.Context) *ServerGetBotConfigCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ServerGetBotConfigCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ServerGetBotConfigCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "server/get_bot_config")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.server.get_bot_config", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.server.get_bot_config" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsFileContent.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServerGetBotConfigCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsFileContent, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsFileContent{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.server.get_bot_config", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type ServerPermissionsCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Permissions: Returns the caller's permissions.
func (r *ServerService) Permissions() *ServerPermissionsCall {
	c := &ServerPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// BotId sets the optional parameter "bot_id":
func (c *ServerPermissionsCall) BotId(botId string) *ServerPermissionsCall {
	c.urlParams_.Set("bot_id", botId)
	return c
}

// Tags sets the optional parameter "tags":
func (c *ServerPermissionsCall) Tags(tags ...string) *ServerPermissionsCall {
	c.urlParams_.SetMulti("tags", append([]string{}, tags...))
	return c
}

// TaskId sets the optional parameter "task_id":
func (c *ServerPermissionsCall) TaskId(taskId string) *ServerPermissionsCall {
	c.urlParams_.Set("task_id", taskId)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ServerPermissionsCall) Fields(s ...googleapi.Field) *ServerPermissionsCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ServerPermissionsCall) IfNoneMatch(entityTag string) *ServerPermissionsCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ServerPermissionsCall) Context(ctx context.Context) *ServerPermissionsCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ServerPermissionsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ServerPermissionsCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "server/permissions")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.server.permissions", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.server.permissions" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsClientPermissions.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServerPermissionsCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsClientPermissions, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsClientPermissions{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.server.permissions", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type ServerTokenCall struct {
	s          *Service
	urlParams_ gensupport.URLParams
	ctx_       context.Context
	header_    http.Header
}

// Token: Returns a token to bootstrap a new bot. This may seem strange to be a
// POST and not a GET, but it's very important to make sure GET requests are
// idempotent and safe to be pre-fetched; generating a token is neither of
// those things.
func (r *ServerService) Token() *ServerTokenCall {
	c := &ServerTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ServerTokenCall) Fields(s ...googleapi.Field) *ServerTokenCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *ServerTokenCall) Context(ctx context.Context) *ServerTokenCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ServerTokenCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *ServerTokenCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "server/token")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.server.token", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.server.token" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsBootstrapToken.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ServerTokenCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsBootstrapToken, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsBootstrapToken{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.server.token", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TaskCancelCall struct {
	s                             *Service
	taskId                        string
	swarmingrpcstaskcancelrequest *SwarmingRpcsTaskCancelRequest
	urlParams_                    gensupport.URLParams
	ctx_                          context.Context
	header_                       http.Header
}

// Cancel: Cancels a task. If a bot was running the task, the bot will forcibly
// cancel the task.
//
// - taskId: .
func (r *TaskService) Cancel(taskId string, swarmingrpcstaskcancelrequest *SwarmingRpcsTaskCancelRequest) *TaskCancelCall {
	c := &TaskCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.taskId = taskId
	c.swarmingrpcstaskcancelrequest = swarmingrpcstaskcancelrequest
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TaskCancelCall) Fields(s ...googleapi.Field) *TaskCancelCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TaskCancelCall) Context(ctx context.Context) *TaskCancelCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TaskCancelCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TaskCancelCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
	body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.swarmingrpcstaskcancelrequest)
	if err != nil {
		return nil, err
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "task/{task_id}/cancel")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, body)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"task_id": c.taskId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.task.cancel", "request", internallog.HTTPRequest(req, body.Bytes()))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.task.cancel" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsCancelResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *TaskCancelCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsCancelResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsCancelResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.task.cancel", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TaskRequestCall struct {
	s            *Service
	taskId       string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Request: Returns the task request corresponding to a task ID.
//
// - taskId: .
func (r *TaskService) Request(taskId string) *TaskRequestCall {
	c := &TaskRequestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.taskId = taskId
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TaskRequestCall) Fields(s ...googleapi.Field) *TaskRequestCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *TaskRequestCall) IfNoneMatch(entityTag string) *TaskRequestCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TaskRequestCall) Context(ctx context.Context) *TaskRequestCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TaskRequestCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TaskRequestCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "task/{task_id}/request")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"task_id": c.taskId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.task.request", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.task.request" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskRequest.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *TaskRequestCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskRequest, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskRequest{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.task.request", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TaskResultCall struct {
	s            *Service
	taskId       string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Result: Reports the result of the task corresponding to a task ID. It can be
// a 'run' ID specifying a specific retry or a 'summary' ID hidding the fact
// that a task may have been retried transparently, when a bot reports
// BOT_DIED. A summary ID ends with '0', a run ID ends with '1' or '2'.
//
// - taskId: .
func (r *TaskService) Result(taskId string) *TaskResultCall {
	c := &TaskResultCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.taskId = taskId
	return c
}

// IncludePerformanceStats sets the optional parameter
// "include_performance_stats":
func (c *TaskResultCall) IncludePerformanceStats(includePerformanceStats bool) *TaskResultCall {
	c.urlParams_.Set("include_performance_stats", fmt.Sprint(includePerformanceStats))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TaskResultCall) Fields(s ...googleapi.Field) *TaskResultCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *TaskResultCall) IfNoneMatch(entityTag string) *TaskResultCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TaskResultCall) Context(ctx context.Context) *TaskResultCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TaskResultCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TaskResultCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "task/{task_id}/result")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"task_id": c.taskId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.task.result", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.task.result" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskResult.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *TaskResultCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskResult, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskResult{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.task.result", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TaskStdoutCall struct {
	s            *Service
	taskId       string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Stdout: Returns the output of the task corresponding to a task ID.
//
// - taskId: .
func (r *TaskService) Stdout(taskId string) *TaskStdoutCall {
	c := &TaskStdoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.taskId = taskId
	return c
}

// Length sets the optional parameter "length":
func (c *TaskStdoutCall) Length(length int64) *TaskStdoutCall {
	c.urlParams_.Set("length", fmt.Sprint(length))
	return c
}

// Offset sets the optional parameter "offset":
func (c *TaskStdoutCall) Offset(offset int64) *TaskStdoutCall {
	c.urlParams_.Set("offset", fmt.Sprint(offset))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TaskStdoutCall) Fields(s ...googleapi.Field) *TaskStdoutCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *TaskStdoutCall) IfNoneMatch(entityTag string) *TaskStdoutCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TaskStdoutCall) Context(ctx context.Context) *TaskStdoutCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TaskStdoutCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TaskStdoutCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "task/{task_id}/stdout")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"task_id": c.taskId,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.task.stdout", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.task.stdout" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskOutput.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *TaskStdoutCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskOutput, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskOutput{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.task.stdout", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TasksCancelCall struct {
	s                              *Service
	swarmingrpcstaskscancelrequest *SwarmingRpcsTasksCancelRequest
	urlParams_                     gensupport.URLParams
	ctx_                           context.Context
	header_                        http.Header
}

// Cancel: Cancel a subset of pending tasks based on the tags. Cancellation
// happens asynchronously, so when this call returns, cancellations will not
// have completed yet.
func (r *TasksService) Cancel(swarmingrpcstaskscancelrequest *SwarmingRpcsTasksCancelRequest) *TasksCancelCall {
	c := &TasksCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.swarmingrpcstaskscancelrequest = swarmingrpcstaskscancelrequest
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TasksCancelCall) Fields(s ...googleapi.Field) *TasksCancelCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TasksCancelCall) Context(ctx context.Context) *TasksCancelCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TasksCancelCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TasksCancelCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
	body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.swarmingrpcstaskscancelrequest)
	if err != nil {
		return nil, err
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/cancel")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, body)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.tasks.cancel", "request", internallog.HTTPRequest(req, body.Bytes()))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.tasks.cancel" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTasksCancelResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *TasksCancelCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTasksCancelResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTasksCancelResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.tasks.cancel", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TasksCountCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Count: Counts number of tasks in a given state.
func (r *TasksService) Count() *TasksCountCall {
	c := &TasksCountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// End sets the optional parameter "end":
func (c *TasksCountCall) End(end float64) *TasksCountCall {
	c.urlParams_.Set("end", fmt.Sprint(end))
	return c
}

// Start sets the optional parameter "start":
func (c *TasksCountCall) Start(start float64) *TasksCountCall {
	c.urlParams_.Set("start", fmt.Sprint(start))
	return c
}

// State sets the optional parameter "state":
//
// Possible values:
//
//	"ALL" (default)
//	"BOT_DIED"
//	"CANCELED"
//	"CLIENT_ERROR"
//	"COMPLETED"
//	"COMPLETED_FAILURE"
//	"COMPLETED_SUCCESS"
//	"DEDUPED"
//	"EXPIRED"
//	"KILLED"
//	"NO_RESOURCE"
//	"PENDING"
//	"PENDING_RUNNING"
//	"RUNNING"
//	"TIMED_OUT"
func (c *TasksCountCall) State(state string) *TasksCountCall {
	c.urlParams_.Set("state", state)
	return c
}

// Tags sets the optional parameter "tags":
func (c *TasksCountCall) Tags(tags ...string) *TasksCountCall {
	c.urlParams_.SetMulti("tags", append([]string{}, tags...))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TasksCountCall) Fields(s ...googleapi.Field) *TasksCountCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *TasksCountCall) IfNoneMatch(entityTag string) *TasksCountCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TasksCountCall) Context(ctx context.Context) *TasksCountCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TasksCountCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TasksCountCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/count")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.tasks.count", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.tasks.count" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTasksCount.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *TasksCountCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTasksCount, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTasksCount{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.tasks.count", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TasksGetStatesCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// GetStates: Returns task state for a specific set of tasks.
func (r *TasksService) GetStates() *TasksGetStatesCall {
	c := &TasksGetStatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// TaskId sets the optional parameter "task_id":
func (c *TasksGetStatesCall) TaskId(taskId ...string) *TasksGetStatesCall {
	c.urlParams_.SetMulti("task_id", append([]string{}, taskId...))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TasksGetStatesCall) Fields(s ...googleapi.Field) *TasksGetStatesCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *TasksGetStatesCall) IfNoneMatch(entityTag string) *TasksGetStatesCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TasksGetStatesCall) Context(ctx context.Context) *TasksGetStatesCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TasksGetStatesCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TasksGetStatesCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/get_states")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.tasks.get_states", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.tasks.get_states" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskStates.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *TasksGetStatesCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskStates, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskStates{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.tasks.get_states", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TasksListCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// List: Returns full task results based on the filters. This endpoint is
// significantly slower than 'count'. Use 'count' when possible. If you just
// want the state of tasks, use 'get_states'.
func (r *TasksService) List() *TasksListCall {
	c := &TasksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Cursor sets the optional parameter "cursor":
func (c *TasksListCall) Cursor(cursor string) *TasksListCall {
	c.urlParams_.Set("cursor", cursor)
	return c
}

// End sets the optional parameter "end":
func (c *TasksListCall) End(end float64) *TasksListCall {
	c.urlParams_.Set("end", fmt.Sprint(end))
	return c
}

// IncludePerformanceStats sets the optional parameter
// "include_performance_stats":
func (c *TasksListCall) IncludePerformanceStats(includePerformanceStats bool) *TasksListCall {
	c.urlParams_.Set("include_performance_stats", fmt.Sprint(includePerformanceStats))
	return c
}

// Limit sets the optional parameter "limit":
func (c *TasksListCall) Limit(limit int64) *TasksListCall {
	c.urlParams_.Set("limit", fmt.Sprint(limit))
	return c
}

// Sort sets the optional parameter "sort":
//
// Possible values:
//
//	"ABANDONED_TS"
//	"COMPLETED_TS"
//	"CREATED_TS" (default)
//	"STARTED_TS"
func (c *TasksListCall) Sort(sort string) *TasksListCall {
	c.urlParams_.Set("sort", sort)
	return c
}

// Start sets the optional parameter "start":
func (c *TasksListCall) Start(start float64) *TasksListCall {
	c.urlParams_.Set("start", fmt.Sprint(start))
	return c
}

// State sets the optional parameter "state":
//
// Possible values:
//
//	"ALL" (default)
//	"BOT_DIED"
//	"CANCELED"
//	"CLIENT_ERROR"
//	"COMPLETED"
//	"COMPLETED_FAILURE"
//	"COMPLETED_SUCCESS"
//	"DEDUPED"
//	"EXPIRED"
//	"KILLED"
//	"NO_RESOURCE"
//	"PENDING"
//	"PENDING_RUNNING"
//	"RUNNING"
//	"TIMED_OUT"
func (c *TasksListCall) State(state string) *TasksListCall {
	c.urlParams_.Set("state", state)
	return c
}

// Tags sets the optional parameter "tags":
func (c *TasksListCall) Tags(tags ...string) *TasksListCall {
	c.urlParams_.SetMulti("tags", append([]string{}, tags...))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TasksListCall) Fields(s ...googleapi.Field) *TasksListCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *TasksListCall) IfNoneMatch(entityTag string) *TasksListCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TasksListCall) Context(ctx context.Context) *TasksListCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TasksListCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TasksListCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/list")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.tasks.list", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.tasks.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskList.ServerResponse.Header or (if a response was returned
// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *TasksListCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskList, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskList{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.tasks.list", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TasksNewCall struct {
	s                          *Service
	swarmingrpcsnewtaskrequest *SwarmingRpcsNewTaskRequest
	urlParams_                 gensupport.URLParams
	ctx_                       context.Context
	header_                    http.Header
}

// New: Creates a new task. The task will be enqueued in the tasks list and
// will be executed at the earliest opportunity by a bot that has at least the
// dimensions as described in the task request.
func (r *TasksService) New(swarmingrpcsnewtaskrequest *SwarmingRpcsNewTaskRequest) *TasksNewCall {
	c := &TasksNewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.swarmingrpcsnewtaskrequest = swarmingrpcsnewtaskrequest
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TasksNewCall) Fields(s ...googleapi.Field) *TasksNewCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TasksNewCall) Context(ctx context.Context) *TasksNewCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TasksNewCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TasksNewCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
	body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.swarmingrpcsnewtaskrequest)
	if err != nil {
		return nil, err
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/new")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, body)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.tasks.new", "request", internallog.HTTPRequest(req, body.Bytes()))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.tasks.new" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskRequestMetadata.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *TasksNewCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskRequestMetadata, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskRequestMetadata{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.tasks.new", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type TasksRequestsCall struct {
	s            *Service
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Requests: Returns tasks requests based on the filters. This endpoint is
// slightly slower than 'list'. Use 'list' or 'count' when possible.
func (r *TasksService) Requests() *TasksRequestsCall {
	c := &TasksRequestsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}

// Cursor sets the optional parameter "cursor":
func (c *TasksRequestsCall) Cursor(cursor string) *TasksRequestsCall {
	c.urlParams_.Set("cursor", cursor)
	return c
}

// End sets the optional parameter "end":
func (c *TasksRequestsCall) End(end float64) *TasksRequestsCall {
	c.urlParams_.Set("end", fmt.Sprint(end))
	return c
}

// IncludePerformanceStats sets the optional parameter
// "include_performance_stats":
func (c *TasksRequestsCall) IncludePerformanceStats(includePerformanceStats bool) *TasksRequestsCall {
	c.urlParams_.Set("include_performance_stats", fmt.Sprint(includePerformanceStats))
	return c
}

// Limit sets the optional parameter "limit":
func (c *TasksRequestsCall) Limit(limit int64) *TasksRequestsCall {
	c.urlParams_.Set("limit", fmt.Sprint(limit))
	return c
}

// Sort sets the optional parameter "sort":
//
// Possible values:
//
//	"ABANDONED_TS"
//	"COMPLETED_TS"
//	"CREATED_TS" (default)
//	"STARTED_TS"
func (c *TasksRequestsCall) Sort(sort string) *TasksRequestsCall {
	c.urlParams_.Set("sort", sort)
	return c
}

// Start sets the optional parameter "start":
func (c *TasksRequestsCall) Start(start float64) *TasksRequestsCall {
	c.urlParams_.Set("start", fmt.Sprint(start))
	return c
}

// State sets the optional parameter "state":
//
// Possible values:
//
//	"ALL" (default)
//	"BOT_DIED"
//	"CANCELED"
//	"CLIENT_ERROR"
//	"COMPLETED"
//	"COMPLETED_FAILURE"
//	"COMPLETED_SUCCESS"
//	"DEDUPED"
//	"EXPIRED"
//	"KILLED"
//	"NO_RESOURCE"
//	"PENDING"
//	"PENDING_RUNNING"
//	"RUNNING"
//	"TIMED_OUT"
func (c *TasksRequestsCall) State(state string) *TasksRequestsCall {
	c.urlParams_.Set("state", state)
	return c
}

// Tags sets the optional parameter "tags":
func (c *TasksRequestsCall) Tags(tags ...string) *TasksRequestsCall {
	c.urlParams_.SetMulti("tags", append([]string{}, tags...))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *TasksRequestsCall) Fields(s ...googleapi.Field) *TasksRequestsCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *TasksRequestsCall) IfNoneMatch(entityTag string) *TasksRequestsCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *TasksRequestsCall) Context(ctx context.Context) *TasksRequestsCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *TasksRequestsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *TasksRequestsCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "tasks/requests")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "swarming.tasks.requests", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "swarming.tasks.requests" call.
// Any non-2xx status code is an error. Response headers are in either
// *SwarmingRpcsTaskRequests.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *TasksRequestsCall) Do(opts ...googleapi.CallOption) (*SwarmingRpcsTaskRequests, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &SwarmingRpcsTaskRequests{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "swarming.tasks.requests", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}
